<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<%@ include file="/WEB-INF/views/include/header.jsp"%>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-site-edit" object="${site}">
            <input id="siteId" name="siteId" value="${site.siteId}"    type="hidden">
            <div class="form-group">	
                <label class="col-sm-3 control-label">站点名称：</label>
                <div class="col-sm-8">
                    <input id="siteName" name="siteName" value="${site.siteName}"    class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">站点简称：</label>
                <div class="col-sm-8">
                    <input id="sitePath" name="sitePath" value="${site.sitePath}"   class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">关键字：</label>
                <div class="col-sm-8">
                    <input id="keywords" name="keywords" value="${site.keywords}"   class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">域名：</label>
                <div class="col-sm-8">
                    <input id="domainName" name="domainName" value="${site.domainName}"   class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">访问协议：</label>
                <div class="col-sm-8">
                    <input id="accessProtocol" name="accessProtocol" value="${site.accessProtocol}"   class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">访问地址：</label>
                <div class="col-sm-8">
                    <input id="accessPath" name="accessPath" value="${site.accessPath}"   class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">模板名称：</label>
                <div class="col-sm-8">
                    <input id="templateName" name="templateName" value="${site.templateName}"   class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">模板路径：</label>
                <div class="col-sm-8">
                    <input id="templatePath" name="templatePath" value="${site.templatePath}"    class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否主站：</label>
                <div class="col-sm-8">
                    <c:forEach items="${fnc:getDictDataByTypeList('cms_ismaster_status')}" var="dict">
                        <div class="radio-box">
                            <input type="radio" id="${dict.dictCode}" name="isMaster" value="${dict.dictValue}"
                                    <c:if test="${dict.dictValue == site.isMaster}"> checked="true" </c:if> />
                            <label for="${dict.dictCode}">${dict.dictLabel}</label>
                        </div>
                    </c:forEach>
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">排序：</label>
                <div class="col-sm-8">
                    <input id="sort" name="sort" value="${site.sort}"   class="form-control" type="text">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <c:forEach items="${fnc:getDictDataByTypeList('sys_normal_disable')}" var="dict">
                        <div class="radio-box">
                            <input type="radio" id="${dict.dictCode}" name="status" value="${dict.dictValue}"
                                    <c:if test="${dict.dictValue == site.status}"> checked="true" </c:if> />
                            <label for="${dict.dictCode}">${dict.dictLabel}</label>
                        </div>
                    </c:forEach>
                </div>
            </div>

            <div class="form-group">	
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input id="remark" name="remark" value="${site.remark}"   class="form-control" type="text">
                </div>
            </div>

		</form>
    </div>
    <%@ include file="/WEB-INF/views/include/footer.jsp"%>
    <script type="text/javascript">
		var prefix = ctx + "cms/site"
		$("#form-site-edit").validate({
			rules:{
                siteName:{
					required:true,
				},
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-site-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
